import Vue from 'vue'
import App from './App.vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import router from '@/router'
import store from '@/store'
import "./utils/day.js";
import "@/style/index.css"
import '@/utils/plday.js'
// 导航守卫
import 'font-awesome/css/font-awesome.min.css'
import "./permission"
/*------------导入面板的mock------------*/
// import './api/dashboard'
// if (process.env.NODE_ENV === "production") {
//     const { mockXHR } = require("./api/mock");
//     mockXHR();
// }
import './api/mock'
// import Components from '@/components'
// Vue.use(Components)
Vue.config.productionTip = false
// Vue.use(ElementUI);
import * as filters from '@/filters' // 引入工具类
// 注册全局的过滤器
Object.keys(filters).forEach(key => {
  // 注册过滤器
  Vue.filter(key, filters[key])
})


import '../mock/mock'
import i18n from './lang'
Vue.use(ElementUI, {
  i18n: (key, value) => i18n.t(key, value)
})

import moment from 'moment'
Vue.prototype.$moment = moment
// 导入全局组件
import Components from '@/components'
Vue.use(Components)

// 读取模块所有dom信息
import * as directive from '@/directive'
console.log(directive);
Object.keys(directive).forEach(key => {
  Vue.directive(key, directive[key])
})

// 全局注册混入
import checkPermission from '@/mixins/checkPermission.js'
Vue.mixin(checkPermission)


new Vue({
  render: h => h(App),
  router,
  store,
  i18n
}).$mount('#app')